﻿using System.Windows;

namespace CoreLib
{
    public delegate void Handler<TSender, TValue>( TSender sender, TValue value );
    public delegate void Handler<T>( T value );
    public delegate void Handler();
    public delegate void RoutedEventHandler<T>( object sender, RoutedEventArgs<T> e );

    public class EventArgs<T>
    {
        private readonly T _value;

        public T Value
        {
            get { return _value; }
        }

        public EventArgs( T value )
        {
            _value = value;
        }
    }

    public class RoutedEventArgs<T> : RoutedEventArgs
    {
        public T Value
        {
            get;
            set;
        }

        public RoutedEventArgs( T value, RoutedEvent evt, object source )
            : base( evt, source )
        {
            Value = value;
        }

        public RoutedEventArgs( T value, RoutedEventArgs e )
            : this( value, e.RoutedEvent, e.OriginalSource )
        {
        }
    }
}
